#include<iostream>
using namespace std;


int i = 1;

class lifetime{
public:
    lifetime(int aa);
    ~lifetime();
};

lifetime::lifetime(int aa = 10)
{   
    static int a=2;
    static int b;
    int c = 10;
    a += 2;
    i += 32;
    c += 5;
    cout << "-------------------\n"<<endl;
    cout << "other\n" << "i=" << i << "\na=" << a << "\nb=" << b << endl;
    b = a ;
}

lifetime::~lifetime()
{
    cout << "destroy lifetime\n"<< endl;
}

int main(){
    static int a;
    int b = -10;
    int c = 0;
    cout <<"main\n"<<endl;
    cout << "i=" << i << "\na=" << a << "\nb=" << b << "\nc="<< c << endl;
    c += 8;
    lifetime life1(100);
    cout << "main\n"<<endl;
    cout << "i=" << i << "\na=" << a << "\nb=" << b << "\nc="<< c << endl;
    i += 10;
    lifetime life2(200);
    return 0;
}